package Thread;

public class Demo12 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 =  new Thread(()->{
            for(int i = 0 ; i < 3 ; i++){
                System.out.println(Thread.currentThread().getName()+":"+i);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }

        });
        System.out.println(t1.getState());
        t1.start();
        t1.join();
        System.out.println(t1.getState());
    }
}
